Skip to content

fix(core): settings i18n refresh#14760

Merged
darkskygit merged 2 commits intocanaryfrom
fix/settings-i18n-wrapper-refresh
Apr 2, 2026
Merged

fix(core): settings i18n refresh#14760
darkskygit merged 2 commits intocanaryfrom
fix/settings-i18n-wrapper-refresh

Conversation

@darkskygit
Copy link
Copy Markdown
Member

@darkskygit darkskygit commented Apr 1, 2026

replace #14758
fixes #13291

PR Dependency Tree

This tree was auto-generated by Charcoal

Summary by CodeRabbit

  • Bug Fixes
    • Settings dialog now respects the app’s active language immediately, ensuring language changes are reflected correctly in the UI.
  • Improvements
    • Internationalization utilities updated to better surface translation hooks for consistent language behavior across the frontend.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 1, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: edd5ae37-d46a-4742-b591-f5294bddd318

📥 Commits

Reviewing files that changed from the base of the PR and between 7cc591b and 50972b4.

📒 Files selected for processing (1)
  • packages/frontend/core/src/desktop/dialogs/setting/index.tsx

Disabled knowledge base sources:

  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.


📝 Walkthrough

Walkthrough

Re-exports useTranslation from the i18n module and updates the settings dialog to read the active i18n language (using resolvedLanguage or language) and key the FrameworkScope by that language to force remount when the language changes.

Changes

Cohort / File(s) Summary
I18n Module Export
packages/frontend/i18n/src/react.ts
Added useTranslation to the re-exports from react-i18next.
Settings Dialog Language Integration
packages/frontend/core/src/desktop/dialogs/setting/index.tsx
Uses useTranslation('translation') to derive currentLanguageKey (i18n.resolvedLanguage ?? i18n.language) and keys FrameworkScope with settings-language-${currentLanguageKey} so it remounts when language changes.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant SettingsDialog as SettingsDialog (React)
    participant I18n as react-i18next
    participant FrameworkScope as FrameworkScope (child)

    User->>SettingsDialog: Open settings / change language
    SettingsDialog->>I18n: call useTranslation('translation')
    I18n-->>SettingsDialog: return i18n with resolvedLanguage/language
    SettingsDialog->>FrameworkScope: render key="settings-language-{currentLanguageKey}"
    alt language value changed
        SettingsDialog->>FrameworkScope: React remounts FrameworkScope
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰
A nibble, a twitch, a translation song,
I hop and I swap the language all day long,
The settings box shivers, then starts anew —
Keyed by the tongue it now knows to use. 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix(core): settings i18n refresh' clearly describes the main change: fixing i18n (internationalization) refresh behavior in the settings component by adding dynamic key-based remounting when language changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/settings-i18n-wrapper-refresh

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/frontend/core/src/desktop/dialogs/setting/index.tsx`:
- Around line 198-201: Remove the language-based key on FrameworkScope to avoid
remounting the entire settings subtree: in the JSX where FrameworkScope is
rendered (currently keyed with `settings-language-${currentLanguageKey}` and
using `scope={currentServer.scope}`), delete the
`key={...currentLanguageKey...}` prop so the component is keyed only by its
stable identity (`currentServer.scope`), and if you need language-driven
updates, implement them inside a narrower child component instead of on
`FrameworkScope`.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3c57b97b-9b1b-4e95-bb5f-42473591abef

📥 Commits

Reviewing files that changed from the base of the PR and between 91ad783 and 7cc591b.

📒 Files selected for processing (2)
  • packages/frontend/core/src/desktop/dialogs/setting/index.tsx
  • packages/frontend/i18n/src/react.ts

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 57.30%. Comparing base (91ad783) to head (50972b4).
⚠️ Report is 5 commits behind head on canary.

Additional details and impacted files
@@            Coverage Diff             @@
##           canary   #14760      +/-   ##
==========================================
- Coverage   57.82%   57.30%   -0.53%     
==========================================
  Files        2960     2961       +1     
  Lines      165735   165765      +30     
  Branches    24428    24298     -130     
==========================================
- Hits        95841    94994     -847     
- Misses      66848    67647     +799     
- Partials     3046     3124      +78     
Flag Coverage Δ
server-test 76.15% <ø> (-0.98%) ⬇️
unittest 34.62% <ø> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@darkskygit darkskygit merged commit 8ca3f2d into canary Apr 2, 2026
30 of 33 checks passed
@darkskygit darkskygit deleted the fix/settings-i18n-wrapper-refresh branch April 2, 2026 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app:core mod:i18n Related to i18n

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

[Bug]: Language switch not applied on the Settings dialog

1 participant